package ysm.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import ysm.entity.Userdetail;
import ysm.mapper.UserdetailMapper;

@Service
public class UserdetailService {
	@Autowired
	private UserdetailMapper userdetailMapper;
	
	public Userdetail selectByPrimaryKey2(Integer uid) {
		return userdetailMapper.selectByPrimaryKey2(uid);
	}
	
	public void updateByPrimaryKey(Userdetail record) {
		if (userdetailMapper.selectByPrimaryKey2(record.getUid()).getId() == null)
			userdetailMapper.insert(record);
		else 
			userdetailMapper.updateByPrimaryKey(record);
	}
}
